<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>核酸检测</title>
    <script src="js/jquery-3.6.0.js" type="text/javascript"></script>
    <script src="bootstrap/js/bootstrap.js" type="text/javascript"></script>
    <link rel="stylesheet" href="bootstrap/css/bootstrap.css">
    <script src="layui/layui.js"></script>
    <link rel="stylesheet" href="layui/css/layui.css">
    <script th:src="@{js/vue.js}"></script>
    <script th:src="@{js/vue-axios.js}"></script>
    <style>
        body{
            margin-top: 0;
            padding: 30px;
        }
    </style>
</head>
<body>
    <div id="ntest">
        <ol class="breadcrumb">
            <li><a href="/mainbg">主页</a></li>
            <li><a href="#">核酸检测</a></li>
            <li><a href="#">用户信息</a></li>
        </ol>
        <table class="table table-bordered table-striped table-hover" style="margin-top: 10px">
            <thead>
            <tr class="info">
                <th>姓名</th>
                <th>性别</th>
                <th>电话</th>
                <th>身份证号</th>
                <th>住址</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <tr>
                <td th:text="${session.user.name}"></td>
                <td th:text="${session.user.sex}"></td>
                <td th:text="${session.user.tel}"></td>
                <td th:text="${session.user.idcard}"></td>
                <td th:text="${session.user.detailedAddress}"></td>
                <td>
                    <button type="button" class="btn btn-warning btn-sm"  @click="nucleicTest()">
                        <span class="glyphicon glyphicon-cog">开始检测</span></button>
                </td>
            </tr>
            </tbody>
        </table>
    </div>
    <script type="text/javascript">
        var vm=new Vue({
            el: "#ntest",
            methods:{
                nucleicTest:function () {
                    axios.get('/nucleicTest')
                        .then(response => {
                            if (response.status == 200) {
                                layer.alert(response.data,{icon:1})
                            }
                        });
                }
            }
        });
    </script>
</body>
</html>